Skip to content

Fix issues in guest logging #410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 10, 2025

Conversation

simongdavies
Copy link
Contributor

Allow explicit setting of max guest log level, , if this is not set check RUST_LOG environment variable.

The guest log level impacts the amount of logs produced by the guest, its presently set by examining the value of max_log_level in the host.

This may not be appropriate since logging in the guest is expensive and it may cause logs to be emitted from the guest but ignored in the host. This change introduces a function on an UninitializedSandbox to set the level explicitly, if this is not set the env var RUST_LOG is parsed to determine the log level so that logs are only produced if they are going to be consumed. If RUST_LOG is not set then the max guest log level is set to error.

Updates inconsistent crate name hyperlight-guest in guest logs to hyperlight_guest

@simongdavies simongdavies added the kind/enhancement For PRs adding features, improving functionality, docs, tests, etc. label Apr 9, 2025
…guest log_level if not set

The guest log level impacts the amount of logs produced by the guest, its presently set by examining the value of max_log_level in the host.

This may not be appropriate since logging in the guest is expensive and it may cause logs to be emitted from the guest but ignored in the host. This change introduces a function on an uninitializedsandbox to set the level explicitly, if this is not set the env var RUST_LOG is parsed to determine the log level so that logs  are only produced if they are going to be consumed.  If RUST_LOG is not set then the max guest log level is set to error.

Signed-off-by: Simon Davies <[email protected]>
@simongdavies simongdavies merged commit 4918fcd into hyperlight-dev:main Apr 10, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement For PRs adding features, improving functionality, docs, tests, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants